<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	seq		= Request("seq")
	incSeq		= Request("incSeq")
	
	if incSeq <> "" then 
		addSql =  " AND B.incSeq=" & incSeq
	end if 
	
	SQLTitle = "-- ■■■■ 회계(입금) 상세 정보 ■■■■"
	
	SQL = "SELECT A.seq, A.accountCd, A.income, A.compCd, A.amount, A.orgAmount, A.tax, A.incomeDt, A.billCd, A.memo, A.billMemo, A.part, CONVERT(varchar(16), ISNULL(A.modDt, A.wDate), 121) modDt, " & _
				"	B.incSeq, ISNULL(B.amount,0) incAmount, B.actionDt, B.bankDt, B.flag incFlag, B.memo incMemo " & _
				" 	FROM tblIncome A LEFT JOIN (SELECT * FROM tblIncResult WHERE flag='Y') B ON A.seq=B.incCd WHERE A.seq=" & seq & addSql

	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Rs.open SQL, DbCon, 1
	
	Response.write "<Income>" & vbcrlf

	If Rs.eof Or Rs.bof Then 
	Else 
		Do Until Rs.eof Or Rs.bof
		
				Call mkXMLNode("seq", rs("seq"), 1)
				Call mkXMLNode("incSeq", rs("incSeq"), 1)
				Call mkXMLNode("incAmount", FormatNumber(rs("incAmount"),0), 1)
				Call mkXMLNode("actionDt", rs("actionDt"), 1)
				Call mkXMLNode("bankDt", rs("bankDt"), 1)
				Call mkXMLNode("incMemo", rs("incMemo"), 1)
				Call mkXMLNode("incFlag", rs("incFlag"), 1)
				Call mkXMLNode("accountCd", rs("accountCd"), 1)
				Call mkXMLNode("income", rs("income"), 1)
				Call mkXMLNode("compCd", rs("compCd"), 1)
				Call mkXMLNode("amount", FormatNumber(rs("amount"),0), 1)
				Call mkXMLNode("orgAmount", FormatNumber(rs("orgAmount"),0), 1)
				Call mkXMLNode("tax", FormatNumber(rs("tax"),0), 1)
				Call mkXMLNode("incomeDt", rs("incomeDt"), 1)
				Call mkXMLNode("billCd", rs("billCd"), 1)
				Call mkXMLNode("part", rs("part"), 1)
				Call mkXMLNode("memo", rs("memo"), 1)
				Call mkXMLNode("billMemo", rs("billMemo"), 1)
				Call mkXMLNode("modDt", rs("modDt"), 1)

		Rs.movenext
		Loop 
	End If
	Response.write "</Income>" & vbcrlf
'	Call rsWithXML("Save OK!")
%>